<!DOCTYPE html>
<html>
<head xmlns:th="http://www.w3.org/1999/xhtml">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>精研 3.0 - 数据表格</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <!-- Data Tables -->
    <link href="/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">

    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min.css?v=4.0.0" rel="stylesheet"><base target="_blank">


    <link rel="shortcut icon" href="favicon.ico"> <link href="/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="/css/plugins/colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
    <link href="/css/plugins/cropper/cropper.min.css" rel="stylesheet">
    <link href="/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="/css/plugins/jasny/jasny-bootstrap.min.css" rel="stylesheet">
    <link href="/css/plugins/nouslider/jquery.nouislider.css" rel="stylesheet">
    <link href="/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="/css/plugins/ionRangeSlider/ion.rangeSlider.css" rel="stylesheet">
    <link href="/css/plugins/ionRangeSlider/ion.rangeSlider.skinFlat.css" rel="stylesheet">
    <link href="/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="/css/plugins/clockpicker/clockpicker.css" rel="stylesheet">

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h1>基本信息（页面加载数据较多，显示比较慢，请耐心等待！）</h1>
                        <div class="">
                                <a style="font-family: Microsoft YaHei;color:brown;font-size:20px;"
                                   href="/company/granteTodayStockInfo?flag=moneyIn" target="_SELF">下载资金流入榜</a>
                                &nbsp;&nbsp;&nbsp; &nbsp;
                                <a style="font-family: Microsoft YaHei;color:hotpink;font-size:20px;"
                                   href="/company/granteTodayStockInfo?flag=moneyInDays" target="_SELF">下载资金流入连续榜</a>
                            &nbsp; &nbsp;
                                 <a  style="font-family: Microsoft YaHei;color:brown;font-size:20px;"  href="/company/granteTodayStockInfo?flag=asc"  target ="_SELF" >下载今日数据</a>
                            &nbsp;&nbsp;&nbsp; &nbsp;
                                 <a  style="font-family: Microsoft YaHei;color:hotpink;font-size:20px;"  href="/company/granteTodayStockInfo?flag=desc"  target ="_SELF" >下载涨幅榜</a>
                        </div>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="../stockInfo/query">
                                <i class="fa fa-wrench"></i>
                            </a>
                            <ul class="dropdown-menu dropdown-user">
                                <li><a href="../stockInfo/query">选项1</a>
                                </li>
                                <li><a href="../stockInfo/query">选项2</a>
                                </li>
                            </ul>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
<!--                    <div class="ibox-content">-->
                        <div >
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                                <tr>
                                    <th>公司简称</th>
                                    <th>公司代码</th>
                                    <th>成交额(单位：亿)</th>
                                    <th>流通市值(单位：亿)</th>
                                    <th>市盈率</th>
                                    <th>涨跌</th>
                                    <th>价格</th>
                                    <th>5日均价</th>
                                    <th>成交量（手）</th>
                                    <th>5日均量（手）</th>
<!--                                    <th>买卖提示</th>-->
                                    <th>强势上升趋势：單價</th>
                                    <th>强势上升趋势：量能</th>
                                    <th>主力资金(单位：万元)</th>
                                    <th>排名变动</th>
                                    <th>连续上升</th>
                                    <th>主力资金流入</th>
                                    <th>预警</th>
                                </tr>
                            </thead>
                            <tbody>
                            <tr class="gradeX" th:each="result,resultStat:${resultList}" >
                                <td th:text="${result.shortName}"></td>
                                <td ><a th:text="${result.companyCode}" th:href="@{'http://stockpage.10jqka.com.cn/'+${#strings.substring(result.companyCode,2,8)}}" th:target ="_BLANK"/></td>
                                <td th:text="${result.tradingVolume}"></td>
                                <td th:text="${result.marketCapitalization}"></td>
                                <td th:text="${result.pe}"></td>
                                <td th:text="${result.zhangDie + '%'}"   th:style="${result.zhangDie > 0 ? 'font-family:arial;color:red;font-size:18px;':'font-family:arial;color:green;font-size:13px;'}" ></td>
                                <td th:text="${result.price}"   th:style="${result.price > result.priceMay5 ? 'font-family:arial;color:magenta;font-size:13px;':'font-family:arial;color:green;font-size:13px;'}" ></td>
                                <td th:text="${result.priceMay5}"   style="font-family:arial;color:brown;font-size:13px;" ></td>
                                <td th:text="${result.vol}"   th:style="${result.vol > result.volMay5 ? 'font-family:arial;color:magenta;font-size:13px;':'font-family:arial;color:green;font-size:13px;'}" ></td>
                                <td th:text="${result.volMay5}"  style="font-family:arial;color:brown;font-size:13px;"  ></td>
<!--                                <td th:text="${result.buyOrSell}"></td>-->
                                <td th:text="${result.strongRise}"></td>
                                <td th:text="${result.strongRiseVol}"></td>
                                <td th:text="${result.totalMoneyIn}"></td>
                                <td th:text="${result.upDownPosition}"></td>
                                <td th:text="${result.positionInDates}"></td>
                                <td ><a th:text="资金流入详情" th:href="@{'/stock/moneyIn?stockName='+${result.companyCode}}" th:target ="_BLANK"/></td>
                                <td th:if="${result.type} eq 0 " >
                                    <a  th:id="${result.id}+'view'"   th:text="加自选" th:onclick="|requestData(${result.id})|" />
                                    <a style="font-family:arial;font-size:15px;display:none;"  th:id="${result.id}+'open'"   th:text="加自选" th:onclick="|requestData(${result.id})|"  />
                                   <a  style="font-family:arial;color:red;font-size:15px;display:none;"  th:id="${result.id}+'close'"   th:text="删自选" th:onclick="|requestDataClose(${result.id})|"/>
                                </td>
                                <td th:if="${result.type} ne 0 " >
                                    <a   style="font-family:arial;color:red;font-size:15px;"  th:id="${result.id}+'view'"   th:text="删自选" th:onclick="|requestDataClose(${result.id})|" />
                                    <a   style="display: none;" th:id="${result.id}+'open'"   th:text="加自选" th:onclick="|requestData(${result.id})|" />
                                     <a  style="font-family:arial;color:red;font-size:15px;display: none;"  th:id="${result.id}+'close'"   th:text="删自选" th:onclick="|requestDataClose(${result.id})|" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        </body>
    </div>
    <script src="/js/jquery.min.js?v=2.1.4"></script>
    <script src="/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="/js/content.min.js?v=1.0.0"></script>
    <script>
        $(document).ready(function () {
            $(".dataTables-example").dataTable();
            var oTable = $("#editable").dataTable();
            oTable.$("td").editable("../example_ajax.php", {
                "callback": function (sValue, y)
                            {
                                var aPos = oTable.fnGetPosition(this);
                                oTable.fnUpdate(sValue, aPos[0], aPos[1])
                             },
                "submitdata": function (value, settings)
                            {
                                return {"row_id": this.parentNode.getAttribute("id"), "column": oTable.fnGetPosition(this)[2]}
                            },
                "width": "90%", "height": "100%"
            })
        });
        function fnClickAddRow() {
            $("#editable").dataTable().fnAddData(["Custom row", "New row", "New row", "New row", "New row"])
        };
        function requestData(code) {
            $.get("/company/markType?type=1&flag=update&id="+code,function(data,status){
                document.getElementById(code+"view").style.display="none";
                document.getElementById(code+"open").style.display="none";
                document.getElementById(code+"close").style.display="block";
                alert("添加成功！");
            });
        };
        function requestDataClose(code) {
            $.get("/company/markType?type=0&flag=update&id="+code,function(data,status){
                document.getElementById(code+"view").style.display="none";
                document.getElementById(code+"close").style.display="none";
                document.getElementById(code+"open").style.display="block";
                alert("删除成功！");
            });
        };
    </script>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>

</html>